#!/usr/bin/env bash

# ----------------------------------------------------------------------
# Filename :  09-hostname-dev.sh
# Version  :  1.0
# Date     :  2020/07/08
# Author   :  Lz
# Email    :  lz843723683@gmail.com
# History  :     
#             Version 1.0, 2020/07/08
# Function :  联研院开发版 - 指定hostname
# Out:        
#              0 => TPASS
#              1 => TFAIL
#              other=> TCONF
# ----------------------------------------------------------------------

## TODO : 测试收尾清除工作
#
HostnameClean_FTLYY_DEV(){
	return $TPASS
}


## TODO: 调用程序退出函数
#    In: $1 => 调用脚本结果值
HostnameExit_FTLYY_DEV(){
        # 调用退出函数，其中调用了clean相关函数
	Exit_FTLIB ${1}
}


## TODO: 用户界面
#
HostnameUSAGE_FTLYY_DEV(){
	USAGE_FTLIB "联研院开发版 - 网卡绑定脚本"
}


## TODO : 测试前的初始化 
#  Out  : 
#         0 => TPASS
#         1 => TFAIL
#         other=> TCONF
HostnameInit_FTLYY_DEV(){
        # 调用初始化函数
	Init_FTLIB "HostnameClean_FTLYY_DEV"
        # 调用用户界面函数
 	HostnameUSAGE_FTLYY_DEV
}


## TODO ：指定hostname
#
HostnameTest01_FTLYY_DEV(){
        local hostname="localhost"

	echo "hostname = $(hostname)"

	if [ "Z$(hostname)" == "Z${hostname}" ];then
		OutputRet_FTLIB ${TPASS}
		RetParse_FTLIB "要求hostname 为 ${hostname}" "False"
	else
		OutputRet_FTLIB ${TFAIL}
		RetParse_FTLIB "要求hostname 为 ${hostname}" "False"
	fi
}


## TODO : Main
#  Out  : 
#         0 => TPASS
#         1 => TFAIL
#         other => TCONF
HostnameMain_FTLYY_DEV(){
	HostnameInit_FTLYY_DEV

	HostnameTest01_FTLYY_DEV

	return ${TPASS}	
}

HostnameMain_FTLYY_DEV
HostnameExit_FTLYY_DEV $?
